//
//  AppController.m
//  TimeBudget
//
//  Created by isempty.chiu on 2010/9/4.
//  Copyright 2010 LifeMotion. All rights reserved.
//

#import "AppController.h"
#import "ProcessMonitor.h"

@implementation AppController
@synthesize appTrigger;

AppController*	appControllerInstance = nil;
+ (AppController*) sharedController
{
	return appControllerInstance;
}

-(id)init
{
	// Assign self to value returned by super's designated initializer 
	// Designated initializer for NSObject is init 	
	if(appControllerInstance != nil)
		return nil;
	
	self = [super init];	
	if(self)
	{
	}
	
	appControllerInstance = self;
	return self;
}

- (void) dealloc
{				
	//UI Control 
	[appTrigger release];
	
	[super dealloc];	
}

//Action
- (IBAction)startStopAction:(id)sender
{
	BOOL	bGoStart = NO;
	if ([appTrigger isSelectedForSegment:0]) 
	{
		bGoStart = YES;
	}
		
	[[ProcessMonitor sharedProcMonitor] runMonitor:bGoStart];
}

@end
